package com.base.cn.platform.os.controller.user.account;

import com.base.cn.platform.os.common.controller.BaseController;
import com.base.cn.platform.os.common.mybatis.Pagination;
import com.base.cn.platform.os.entity.user.account.CusUserAccountHistory;
import com.base.cn.platform.os.entity.user.account.CusUserAccountHistoryColumns;
import com.base.cn.platform.os.service.user.account.CusUserAccountHistoryBiz;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Data 用户账户历史
 * @ClassName  CusUserAccountHistoryController
 * @author :ll
 * @Create Date : 2018年4月25日
 */
@RestController
@RequestMapping("/manage/user")
public class CusUserAccountHistoryController extends BaseController {

    @Autowired
    private CusUserAccountHistoryBiz cusUserAccountHistoryBiz;

    /**
     * 查看账户详情
     * @paramaccountHistory
     * @return 显示页面
     */
    @RequestMapping("/userAccountHistoryListPage")
    public PageInfo<CusUserAccountHistory> userAccountHistoryListPage(@RequestBody CusUserAccountHistoryColumns accountHistory,
                                                                      @RequestParam(value = "currentPage",required =false,defaultValue = "1")Integer currentPage,
                                                                      @RequestParam(value = "createUserData",required =false,defaultValue = "false")boolean createUserData ){
        Pagination page = new Pagination();
        page.setCurrentPage(currentPage);
        return  cusUserAccountHistoryBiz.queryUserAccountHistoryListPage(accountHistory,page,createUserData);
    }

    /**
     * 查找账户历史列表
     * @param accountHistory
     * @param createUserData
     * @return
     */
    @RequestMapping("/findUserAccountHistoryList")
    public List<CusUserAccountHistory> findUserAccountHistoryList(@RequestBody CusUserAccountHistoryColumns accountHistory,
                                                                      @RequestParam(value = "createUserData",required =false,defaultValue = "false")boolean createUserData){
        return cusUserAccountHistoryBiz.queryUserAccountHistoryList(accountHistory,createUserData);
    }
}
